#! /usr/bin/perl -w

use strict;
use IO::Socket;

use constant SIMPLE_TCP_PORT => 4001;
use constant REMOTE_HOST => 'localhost';

my $remote = shift || REMOTE_HOST;
my $remote_port = shift || SIMPLE_TCP_PORT;

my $sock_obj = IO::Socket::INET->new( 	PeerAddr 	=> $remote,
					PeerPort 	=> $remote_port,
					Proto 		=> 'tcp' )
	or die "oo_tcp_c3: could not create socket object: $!\n";
while ( <$sock_obj> )
{
	print $_;
}
$sock_obj->close;
